﻿using System;
using System.Diagnostics;
using System.Configuration;

namespace mForum.Core.Infrastructure.Configuration.ConfigurationSections
{
    using mForum.Core.Common;

    public class SettingsConfigurationSection : ConfigurationSection
    {
        private static string _sectionName = "mForum";

        public static string SectionName
        {
            [DebuggerStepThrough]
            get
            {
                return _sectionName;
            }

            [DebuggerStepThrough]
            set
            {
                Check.Argument.IsNotEmpty(value, "value");

                _sectionName = value;
            }
        }


        [ConfigurationProperty("SiteTitle", DefaultValue = "mForum")]
        public string SiteTitle
        {
            [DebuggerStepThrough]
            get
            {
                return (string)this["SiteTitle"];
            }

            [DebuggerStepThrough]
            set
            {
                this["SiteTitle"] = value;
            }
        }

        [ConfigurationProperty("MetaKeywords", DefaultValue = "")]
        public string MetaKeywords
        {
            [DebuggerStepThrough]
            get
            {
                return (string)this["MetaKeywords"];
            }

            [DebuggerStepThrough]
            set
            {
                this["MetaKeywords"] = value;
            }
        }

        [ConfigurationProperty("MetaDescription", DefaultValue = "")]
        public string MetaDescription
        {
            [DebuggerStepThrough]
            get
            {
                return (string)this["MetaDescription"];
            }

            [DebuggerStepThrough]
            set
            {
                this["MetaDescription"] = value;
            }
        }

        [ConfigurationProperty("MinPasswordLength", DefaultValue = 5)]
        public int MinPasswordLength
        {
            [DebuggerStepThrough]
            get
            {
                return (int)this["MinPasswordLength"];
            }

            [DebuggerStepThrough]
            set
            {
                this["MinPasswordLength"] = value;
            }
        }
    }
}
